package per.jdz.register;

import per.jdz.common.constants.Register;
import per.jdz.spi.ExtensionLoader;

import java.io.IOException;

/**
 * @description:
 * @Author: Jdz
 * @CreateTime: 2024-03-10 21:11
 */
public class RegistryFactory {


    public static RegistryService get(Register register){
        return ExtensionLoader.getInstance().get(register.name);
    }


    public static RegistryService get(String name){
        return ExtensionLoader.getInstance().get(name);
    }

    public static void init() throws IOException, ClassNotFoundException {
        ExtensionLoader.getInstance().loadExtension(RegistryService.class);
    }
}
